#include<stdio.h>
int main(){
    int t, sum, n, input;
    scanf("%d",&t);
    while(t--){
        sum = 0;
        scanf("%d", &n);
        while(n--){
            scanf("%d", &input);
            sum += input;
        }
        printf("%d\n", sum);
    }
    return 0;
}